package cn.schoolwow.workflow.module.task.action.flow.complete.nodeType.gateway.common;

import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import cn.schoolwow.workflow.entity.WorkFlowNodeJump;

import java.util.List;

public class SetMatchSuccessorJumpNodeListCommonFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        flowContext.executeFlowList(new SetSuccessorJumpNodeListCommonFlow());

        List<WorkFlowNodeJump> successorJumpNodeList = flowContext.checkData("successorJumpNodeList", List.class);
        String gatewayNodeTypeName = flowContext.checkData("gatewayNodeTypeName", String.class);

        flowContext.putCurrentFlowData("workFlowNodeJumpList", successorJumpNodeList)
                .putCurrentFlowData("gatewayNodeTypeName", gatewayNodeTypeName)
                .executeFlowList(new SetMatchWorkFlowNodeJumpListCommonFlow());
    }

    @Override
    public String name() {
        return "设置满足条件的后继节点列表公共流程";
    }

}
